<?php
/***********************************************************************
 * @package     IvanEngine
 * @subpackage  Framework
 * @author      Ivan <ivanzx@msn.com>
 * @created     2010-05-23
 ***********************************************************************/
if(defined("PLUGINS_HOMEPAGE_VIEW"))
    die("Redefinition macro in :".__FILE__."(".__LINE__.")");
define("PLUGINS_HOMEPAGE_VIEW", true);

require_once (M_ENGINE_PATH.'MVC/View.php');

class CHomePageView extends CView 
{
 public function __construct()
    {
        $winName    = CWindowManager::Get()->GetRoot()->GetName();
        $renderMode = self::RM_HTML;
        parent::__construct($winName, $renderMode);
    }

    public function __destruct()
    {
        parent::__destruct();
    }
    
    public function Render($previously = true, $aftermost = true)
    {
        $actionName = CRequest::Get()->GetParameter('Action');
        if( $actionName == 'Requisite' )
        {
            $content    = $this->m_content;
            if( !empty($this->m_preScript) ){
                $content = str_replace('<!--{{prescript}}-->', 
                    $this->m_preScript, $content);
            }
            if( !empty($this->m_preContent) ){
                $content = str_replace('<!--{{content}}-->', 
                    $this->m_preContent, $content);
            }
            if( !empty($this->m_script) ){
                $content = str_replace('<!--{{script}}-->', 
                    $this->m_script, $content);
            }
            CPrinter::Get()->GetRoot()->AddContent($content);
        }else{
            parent::Render($previously, $aftermost);
        }
    }
}
?>
